<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGoodsSpecificationsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('goods_specifications', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('goods_id')->unsigned()->comment('商品 id');
            $table->string('spec_father_name')->comment('规格父名称');
            $table->string('spec_som_name')->comment('规格子名称');
            $table->decimal('original_price', 10, 2)->comment('原始价格、批发价');
            $table->integer('stock')->unsigned()->comment('库存');
            $table->string('cn')->comment('货号');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('goods_specifications');
    }
}
